package com.gewu.pm.ui.activity.delivery;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.widget.ImageView;

import com.bumptech.glide.load.MultiTransformation;
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
import com.bumptech.glide.load.resource.bitmap.CircleCrop;
import com.gewu.pm.R;
import com.gewu.pm.app.AppActivity;
import com.gewu.pm.http.glide.GlideApp;

/**
 * 查看发票Activity
 */
public final class InvoiceViewActivity extends AppActivity {

    private ImageView mInvoiceImageView;

    public static void start(Context context) {
        Intent intent = new Intent(context, InvoiceViewActivity.class);
        context.startActivity(intent);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.invoice_view_activity;
    }

    @Override
    protected void initView(Bundle savedInstanceState) {
        mInvoiceImageView = findViewById(R.id.iv_invoice);
    }

    @Override
    protected void initData() {
        // 使用占位图显示发票
        //mInvoiceImageView.setImageResource(R.drawable.image_loading_bg);
        GlideApp.with(this)
                .load(R.drawable.example_bg)
                .transform(new MultiTransformation<>(new CenterCrop(), new CircleCrop()))
                .into(mInvoiceImageView);
    }
}

